// pages/list/list.js
//获取应用实例
const app = getApp()

Page({
  data: {
    hidden: true,
    addfocus: true,
    addfocus1: false,
    addSouc: true,
    addSouc1: false,
    winHeight:'500',
    imgUrls: [
      {
        url: '../../images/zuopinbang.png',
        text: '风云作品榜'
      },{
        url: '../../images/zuopingxiao.png',
        text: '风云大咖榜'
      },{
        url: '../../images/zuopingxiao.png',
        text: '风云达人榜'
      }
    ],
    swiperIndex: 0 //这里不写第一次启动展示的时候会有问题
  },
  stopTouchMove: function () {
    return false;
  },
  bindchange(e) {
    this.setData({
      swiperIndex: e.detail.current
    })
    console.log(1);
  },
  addFocus: function () {
    this.setData({
      addfocus: false,
      addfocus1: true,
    })
    wx.showToast({
      title: '关注成功',
      icon: "none",
      duration: 1500,
      mask: true
    })
  },
  addFocus1: function () {
    this.setData({
      addfocus: true,
      addfocus1: false,
    })
    wx.showToast({
      title: '取消关注',
      icon: "none",
      duration: 1500,
      mask: true
    })
  },
  addSouc: function () {
    this.setData({
      addSouc: false,
      addSouc1: true,
    })
    // wx.showToast({
    //   title: '收藏成功',
    //   icon: "none",
    //   duration: 1500,
    //   mask: true
    // })
  },
  addSouc1: function () {
    this.setData({
      addSouc: true,
      addSouc1: false,
    })
    // wx.showToast({
    //   title: '取消关注',
    //   icon: "none",
    //   duration: 1500,
    //   mask: true
    // })
  },
  goDetails: function (e) {
    console.log(e.currentTarget.dataset.url);
    wx.navigateTo({
      url: e.currentTarget.dataset.url
    })
  },
  goAuthor: function () {
    wx.navigateTo({
      url: '../author/author'
    })
  },
  goManyi: function (e) {
    console.log(e.currentTarget.dataset.url);
    wx.redirectTo({
      url: e.currentTarget.dataset.url
    })
  }
})
